package com.yjhb.android.sbz.activity

import com.yjhb.android.sbz.R
import com.yjhb.android.sbz.mvp.contact.ContactUSPresenter
import com.yjhb.android.sbz.mvp.contact.ContactUSView
import com.yjhb.android.sbz.tool.Tool
import kotlinx.android.synthetic.main.activity_contact_us.*


/**
 *  创建者 zx
 *  创建时间 2021/3/30 15:27
 */
class ContactUSActivity : BaseActivity<ContactUSPresenter>(), ContactUSView {

    override fun initPresenter(): ContactUSPresenter? {
        return ContactUSPresenter(this)
    }

    override fun getLayoutId() = R.layout.activity_contact_us

    override fun initUI() {

    }

    override fun initData() {

    }

    override fun regEvent() {
        back.setOnClickListener { finish() }
        contact_tv.setOnClickListener { presenter.contact(1) }
        contact2_tv.setOnClickListener { presenter.contact(2) }
        contact3_tv.setOnClickListener { presenter.contact(3) }
    }

    override fun onWait() {
        loadingDialog.show()
    }

    override fun onSuccess(id: String) {
        loadingDialog.cancel()
        Tool.startChatActivity(this,id,"客服${id}",7)
    }

    override fun onFailure(code: Int, msg: String?) {
        loadingDialog.cancel()
    }
}